package com.hongxin.doc.common.onlyoffice.token.edit;

public class EditProperties {
    public String documentType;
    public DocumentProperties document;
    public EditorConfigProperties editorConfig;

    public EditProperties(String fileType, String docKey, String docTitle, String docUrl, String callbackUrl, UserProperties userProperties) {
        switch (fileType) {
            case "docx", "doc" -> this.documentType = "word";
            case "xlsx", "xls" -> this.documentType = "cell";
            case "pptx" -> this.documentType = "slide";
        }
        this.document = new DocumentProperties(fileType, docKey, docTitle, docUrl);
        this.editorConfig = new EditorConfigProperties(callbackUrl, userProperties);
    }


    @Override
    public String toString() {
        return "EditProperties{" +
                "document=" + document +
                ", editorConfig=" + editorConfig +
                "} " + super.toString();
    }
}
